package com.hitemole.network;
import com.badlogic.gdx.math.Vector2;
import com.esotericsoftware.kryo.Kryo;
import com.esotericsoftware.kryonet.EndPoint;

// This class is a convenient place to keep things common to both the client and server.
public class Network {
	static public final int tcpPort = 34556;
	static public final int udpPort= 34557;
	// This registers objects that are going to be sent over the network.
	static public void register (EndPoint endPoint) {
		Kryo kryo = endPoint.getKryo();
		kryo.register(RegisterName.class);
		kryo.register(String[].class);
		kryo.register(Vector2.class);
		kryo.register(UpdateNames.class);
		kryo.register(GameMessage.class);
		kryo.register(ClientInfo.class);
	}

	static public class RegisterName {
		public String name;
	}

	static public class UpdateNames {
		public String[] names;
	}

	static public class GameMessage {
		public int id;
		public Vector2 mouseClick;
	}
	
	static public class ClientInfo{
		public int width,height;
	}
}
